package com.education.liteormtest;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.litesuits.orm.db.assit.QueryBuilder;

import java.util.List;

public class MainActivity extends AppCompatActivity {
    private Button mBtnInsert;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mBtnInsert = (Button) findViewById(R.id.btn_insert);
        mBtnInsert.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Student zhangsan = new Student("张三", "男", "一年级二班");
//                App.liteOrm.insert(zhangsan);

              QueryBuilder<Student> queryBuilder=
                      new QueryBuilder<Student>(Student.class)
                      .where("clazz Like ? ",new String[]{"%二班%"})
                      ;

                List<Student> students=App.liteOrm.query(queryBuilder);
            }
        });
    }
}
